home *** CD-ROM | disk | FTP | other *** search
- Q32660 far and _saveregs Access Parameters Incorrectly
- C Compiler
- 5.10 | 5.10
- MS-DOS | OS/2
-
- Summary:
- Using the _saveregs attribute with a far function will cause the
- function to incorrectly access function parameters. The code that is
- generated does not take into account the extra two bytes that are on
- the stack for the far return address.
- Microsoft has confirmed this to be a problem in Version 5.10. We
- are researching this problem and will post new information as it
- becomes available.
- The following example illustrates this problem:
-
- far _saveregs test2(int parm)
- {
- printf("\nIn far _saveregs function, parm should be 7, is = %d\n",parm);
- return (parm);
- }
-
- main() {
- int arg = 7;
- printf("\nBefore call to far _saveregs func, argument = %d\n",arg);
-
- arg = test2(arg);
-
- printf("\nAfter call to far _saveregs func, argument = %d\n",arg);
- }
-
-
- Keywords: buglist5.10 qfbv
- Updated 88/07/21 03:19
-